package szc.common.code.rule;

import szc.common.code.enums.CodeLineParserEnum;
import szc.common.code.enums.FileTypeEnum;

/**
 * @desc 解析器：单行注释
 * @author songzc
 * @date 2022/6/18
 */
public class SingleCommentCodeLineParser extends CodeLineParserAbstract {
	public SingleCommentCodeLineParser(FileTypeEnum fileTypeEnum) {
		this.parserType = CodeLineParserEnum.SINGLE_COMMENT_CODE_LINE;
		this.fileTypeEnum = fileTypeEnum;
	}

	@Override
	public boolean parseCodeLine() {
		if (this.codeLine.startsWith(fileTypeEnum.getSingleComment())) {
			++this.lineCount;
			return true;
		}
		return false;
	}

}